﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using EM.Repository.utility;
using System.Data.SqlClient;
using System.Data;

namespace EMS.usercontrols
{
    public partial class Pagetitle : System.Web.UI.UserControl
    {

        public int PageID { get; set; }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                DbHelper _helper = new DbHelper();

                SqlCommand cmd = new SqlCommand();
                cmd.CommandText = " SELECT PAGENAME FROM TBLPAGE_L WHERE PAGEID = @PAGEID AND LANGCODE = @LANGCODE ";

                cmd.Parameters.AddWithValue("@PAGEID", this.PageID);
                cmd.Parameters.AddWithValue("@LANGCODE", Session["LANGCODE"] != null ? Session["LANGCODE"].ToString() : "TR");

                DataTable dt = _helper.GetDataTable(cmd, "");
                if (dt.Rows.Count > 0)
                    lblTitle.Text = dt.Rows[0][0].ToString();
            }
        }
    }
}